package com.aaa.service.impl;

import com.aaa.dao.Term_Financial_Mapper;
import com.aaa.pojo.Change;
import com.aaa.pojo.Term_Financial;
import com.aaa.service.Term_Financial_service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class Term_Financial_ServiceIMpl implements Term_Financial_service {
    @Autowired
    private Term_Financial_Mapper mapper;

    @Override
    public PageInfo<Term_Financial> getAllUsersByPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);//这行是重点，表示从pageNum页开始，每页pageSize条数据
        List<Term_Financial> list = mapper.selectAll();
        PageInfo<Term_Financial> pageInfo = new PageInfo<Term_Financial>(list);
        return pageInfo;
    }

    @Override
    public boolean insertFinancial(Term_Financial financial) {
        return mapper.insertFinancial(financial);
    }

    @Override
    public Term_Financial selectById(Integer t_id) {
        return mapper.selectById(t_id);
    }

    @Override
    public boolean updateFinancial(Term_Financial financial) {
        return mapper.updateFinancial(financial);
    }

    @Override
    public boolean deleteFinancial(Integer t_id) {
        return mapper.deleteFinancial(t_id);
    }
}
